<template>
  <view>
    <view>{{ count }}</view>
    <view>
      <button @click="handleSet(1)">+1</button>
      <button @click="handleSet(-1)">-1</button>
    </view>
  </view>
</template>

<script>
export default {
  computed: {
    count() {
      return this.$store.state.count;
    },
  },
  methods: {
    handleSet(num) {
      //console.log(num);
      this.$store.commit("setCount", num);
    },
  },
};
</script>

<style></style>
